<include file="Public:header" />

<style>
.list-group .list-group{margin-bottom:-1px; margin-left:0; margin-right:0; padding:0;}
.list-group .list-group li{margin:0; border:none;}
.list-group {
	padding: 0 5px;
}
.list-group li { 
	line-height: 1.75em;
	margin-bottom:4px;
	margin-top:4px;
	border-color:#b2b2b2;
	border-radius:3px;
}
.list-group li a {
	display: block;
}
.list-group li a .badge {
	float: right;
}
.list-group-item{padding:5px 15px;}
.list-group-item:first-child {
	
}
.media {
	padding: 10px;
	margin-top: 0px;
	background: #fff;
	margin-bottom: 4px;
}
.media p {
	margin-bottom: 0px;
}
.list-group-item:last-child {
	
}
.badge {
	background-color: transparent;
	color:#f00;
}


.headernav{display:none;}
.panel-body{padding:0;}


.nav-glyphicons-list {
	display: table;
	width: 100%;
	padding-left: 0;
	list-style: none;
}
.nav-glyphicons li {
	display: table-cell;
	text-align: center;
    *display: inline-block;
    +float:left;
    
}
.nav-glyphicons li ul li {
	display: block;
}
.nav-glyphicons li a {
	display: inline-block;
	width: 100%;
    _width:auto;
	padding-top:0.2em;
}
.nav-glyphicons .glyphicon-class {
	display: block;
	text-align: center;
	word-wrap: break-word
}
.nav-glyphicons .dropdown-menu {
	border-radius: 0;
	padding-top: 0;
	padding-bottom: 0;
}
.dropdown-menu{min-width:inherit;}
.Mbutton .fa,.Mbutton .glyphicon{font-size:20px; width:40px; margin-bottom:5px; height:40px; border-radius:30px; line-height:40px; text-align:center;}
.Mbutton{padding:5px 0; background:#fff; margin-bottom:3px;}
.Bbutton{padding:5px 0; background:#fff;}
.DataList .list-group{display:none;}
.Aff_row{text-align:center; padding:8px 0; border-bottom:1px solid #b2b2b2;}
.Aff_row .fa{font-size:18px;}
</style>
<div class="media" style="background-image:url(/Public/i.jpg); background-size:auto 100%; background-position:center right; background-repeat:no-repeat; background-color:#c6a8e3; color:#fff;">
  <div class="media-left media-middle"> <a href="#"> <img class="media-object" src="{$_SESSION['memberInfo']['img_url']}" width="60" style="border-radius:50px;" alt=""> </a> </div>
  <div class="media-body">
    <h4 class="media-heading">欢迎您：{$_SESSION['memberInfo']['nickname']}</h4>
    <p style="font-family:'微软雅黑';">ID:{$_SESSION['memberInfo']['id']}　<!--注册时间：{:date('Y-m-d', $_SESSION['memberInfo']['reg_time'])}--></p>
    <if condition="$parent_info">
      <p>您来自<span style="color:#f00;"><empty name="parent_info['nickname']">{$parent_info['username']}</empty>{$parent_info.nickname}</span>的推荐<neq name="LevelName" value="">【级别：{$LevelName}】</neq></p>
      <else/>
      <p>您是创始人<neq name="LevelName" value="">【级别：{$LevelName}】</neq></p>
    </if>
    
    
    
    
    
  </div><eq name="userInfo['level']" value="0">
<div class="alert alert-warning" role="alert" style="margin:0 5px 5px 5px; padding:5px; background:#fff; text-align:center; font-size:10px; margin-top:8px; color:#000; border:none;">
     <a href="__APP__/"> 您还没有成为小伙伴哦，赶紧点击购物加入吧！</a>
    </div>

</eq>
</div>
 
 
 
 
 <div class="row Aff_row">
     <div class="col-xs-6"><i class="fa fa-yen" style="background:#000; color:#fff; border-radius:15px; display:inline-block; width:30px; height:30px; display:inline-block; line-height:30px;"></i> 总营业额：<if condition="$zper eq 0 ">0<else />{$zper}</if></div>
     
     <div class="col-xs-6" style="border-left:1px solid #000;"><i class="fa fa-yen"></i> 本月佣金：<if condition="$commission eq 0 ">0<else />{$commission}</if></div>
 </div>
 
 
 <div class="row Aff_row">
     
     
     <div class="col-xs-12" style="padding-left:20px;text-align:left;"><i class="fa fa-yen"></i> 我的消费：<if condition="$mySaleTotal eq 0 ">0<else />{$mySaleTotal}</if></div>
 </div>


 

<div class="nav-glyphicons Mbutton" style="margin-left:5px; margin-right:5px;">
      <ul class="nav-glyphicons-list" style="background-color:#fff">
        <li class=""><a href="{:U('Order/index',array('state'=>1))}"><span class="fa fa-credit-card" style="background:#4fc1e9; color:#fff;" aria-hidden="true"></span><span class="glyphicon-class">待支付</span></a></li>
        <li class=""><a href="{:U('Order/index',array('state'=>2))}"><span class="fa fa-truck" style="background:#ec7480; color:#fff;" aria-hidden="true"></span><span class="glyphicon-class">待发货</span></a></li>
        <li class=""><a href="{:U('Order/index',array('state'=>3))}"><span class="fa fa-calendar-o" style="background:#b39aed; color:#fff;" aria-hidden="true"></span><span class="glyphicon-class">待收货</span></a></li>
        
        
        <li class=""><a href="{:U('Order/index',array('state'=>7))}"><span class="fa fa-edit" style="background:#17cb96; color:#fff;" aria-hidden="true"></span><span class="glyphicon-class">已取消</span></a></li>
        <li class=""><a href="{:U('Order/index',array('state'=>6))}"><span class="fa fa-flag-o" style="background:#ff943d; color:#fff;" aria-hidden="true"></span><span class="glyphicon-class">已完成</span></a></li>
        
        
      </ul>
    </div>
 

<ul class="list-group DataList">
  <li class="list-group-item"><a href="javascript:void(0);"><i class="fa fa-caret-right"></i> 我的朋友<span class="badge" style="color:#000;" id="usercount"><img width="10" src="__PUBLIC__/loading.gif"></span></a></li>
  <ul class="list-group">
  <li class="list-group-item">
    <a href="{:U('userlist', array('deep' => 1))}"><span class="badge" id="usercount1"><img width="10" src="__PUBLIC__/loading.gif"></span>
    <i class="fa fa-plus-square-o"></i> 一级代言人</a>
  </li><li class="list-group-item">
    <a href="{:U('userlist', array('deep' => 2))}"><span class="badge" id="usercount2"><img width="10" src="__PUBLIC__/loading.gif"></span>
    <i class="fa fa-plus-square-o"></i> 二级代言人</a>
  </li><li class="list-group-item">
    <a href="{:U('userlist', array('deep' => 3))}"><span class="badge" id="usercount3"><img width="10" src="__PUBLIC__/loading.gif"></span>
    <i class="fa fa-plus-square-o"></i> 三级代言人</a>
  </li>
</ul>





<li class="list-group-item"><a href="javascript:void(0);"><i class="fa fa-caret-right"></i> 我的合伙人<span class="badge" style="color:#000; float:right" id="usercountall"><img width="10" src="/Public/loading.gif"></span></a></li>


  <ul class="list-group">
  <li class="list-group-item">
    <a href="javascript:void(0);"><span class="badge" id="vipusercount1"><img width="10" src="/Public/loading.gif"></span>
    <i class="fa fa-plus-square-o"></i> 一级VIP</a>
  </li><li class="list-group-item">
    <a href="javascript:void(0);"><span class="badge" id="vipusercount2"><img width="10" src="/Public/loading.gif"></span>
    <i class="fa fa-plus-square-o"></i> 团队VIP</a>
  </li>
  
</ul>











<li class="list-group-item"><a href="javascript:void(0);"><span class="badge" id="orderPayedc" style="color:#000;"><img width="10" src="__PUBLIC__/loading.gif"></span><i class="fa fa-caret-right"></i> 代言人推广</a></li>

<ul class="list-group">
  <li class="list-group-item">
    <span class="badge" id="orderNoPay"><img width="10" src="__PUBLIC__/loading.gif"></span>
    <i class="fa fa-plus-square-o"></i> 下单未购买
  </li><li class="list-group-item">
    <span class="badge" id="orderPayed"><img width="10" src="__PUBLIC__/loading.gif"></span>
    <i class="fa fa-plus-square-o"></i> 下单已购买
  </li>
</ul>




  <li class="list-group-item"><a href="javascript:void(0);"><i class="fa fa-caret-right"></i> 我的奖励<span class="badge" id="usercount_1" style="color:#000;"><img width="10" src="__PUBLIC__/loading.gif"></span></a></li>
  
  
  
  <ul class="list-group">
  <li class="list-group-item">
    <span class="badge" id="AffMCount_1"><img width="10" src="__PUBLIC__/loading.gif"></span>
    <i class="fa fa-plus-square-o"></i> 未付款订单财富
  </li>
  <li class="list-group-item">
    <span class="badge" id="AffMCount_2"><img width="10" src="__PUBLIC__/loading.gif"></span>
    <i class="fa fa-plus-square-o"></i> 已付款订单财富
  </li>
  
  
  <li class="list-group-item">
    <span class="badge" id="AffMCount_3"><img width="10" src="__PUBLIC__/loading.gif"></span>
    <i class="fa fa-plus-square-o"></i> 已收货订单财富
  </li>
  <li class="list-group-item">
    <span class="badge" id="AffMCount_4"><img width="10" src="__PUBLIC__/loading.gif"></span>
    <i class="fa fa-plus-square-o"></i> 已完成订单财富
  </li>
  
  
  <li class="list-group-item">
    <span class="badge" id="AffMCount_5"><img width="10" src="__PUBLIC__/loading.gif"></span>
    <i class="fa fa-plus-square-o"></i> 已提现财富
  </li>
  <li class="list-group-item">
    <span class="badge" id="AffMCount_6"><img width="10" src="__PUBLIC__/loading.gif"></span>
    <i class="fa fa-plus-square-o"></i> 可提现财富
  </li>
  
  
  
  
</ul>


<li class="list-group-item"><a href="{:U('Coupon/index')}"><i class="fa fa-caret-right"></i> 优惠券</a></li>
  <li class="list-group-item"><a href="{:U('Member_account_log/divide')}"><i class="fa fa-caret-right"></i> 分成明细</a></li>
  <li class="list-group-item"><a href="{:U('Home/Cart/index')}"><i class="fa fa-caret-right"></i> 购物车</a></li>
  <li class="list-group-item"><a href="{:U('Aftermarket/index')}"><i class="fa fa-caret-right"></i> 退货管理</a></li>
</ul>
<gt name="userInfo['level']" value="0">


<volist name="affdata" id="vo">


<div class="panel panel-success" style="margin:5px 5px 5px 5px;">
  <div class="panel-heading"><i class="glyphicon glyphicon-calendar"></i>{$vo.levelname}营业统计</div>
  <div class="panel-body">
    <div class="nav-glyphicons Bbutton" style="border-radius:8px;">
      <ul class="nav-glyphicons-list" style="background-color:#fff">
        <li class=""><a href=""><span class="" aria-hidden="true">{$vo.orderTotal}</span><span class="glyphicon-class">总营业额</span></a></li>
        <li class=""><a href=""><span class="" aria-hidden="true">{$vo.orderCount}</span><span class="glyphicon-class">订单数</span></a></li>
        <li class=""><a href=""><span class="" aria-hidden="true">{$vo.orderAffMoney}</span><span class="glyphicon-class">佣金</span></a></li>
      </ul>
    </div>
  </div>
</div>



</volist>

<else/>



</gt>
<notempty name="integrals">
<div class="panel panel-success" style="margin:0 5px 5px 5px;">
  <!--<div class="panel-heading"><i class="glyphicon glyphicon-calendar"></i>营业统计</div>-->
  <div class="panel-body">
    <div class="nav-glyphicons Bbutton">
      <ul class="nav-glyphicons-list" style="background-color:#fff">
        <volist name="integrals" id="vo">
        <li class=""><a href=""><span class="" aria-hidden="true"><if condition="$vo.number eq 0 ">0<else />{$vo.number}</if></span><span class="glyphicon-class">{$vo.remark}</span></a></li>
        </volist>
      </ul>
    </div>
  </div>
</div>
</notempty>

<a href="{:U('Member_account_log/detailmes')}" class="btn btn-success" style="background:#9b80d9; border:none; display:block; margin:0 20px;">资金提现</a>



<div style="text-align:center;"><span class="badge" id="createqrcode_" style="display:none; text-align:center;">正在生成，请稍等……</span></div>


<script>
    $(document).ready(function(e) {
		$('.DataList > .list-group-item').each(function(index, element) {
			$(this).click(function(e) {
                if($(this).next('ul.list-group').css('display') == 'block'){
					$(this).next('ul.list-group').hide();
				}else{
					$(this).next('ul.list-group').show();
				}
            });
            
			
        });
		
		
		
		$('#createqrcode').click(function(e) {
			$('#createqrcode_').html('<img width="10" src="__PUBLIC__/loading.gif">正在生成，请稍等……');
			$('#createqrcode_').show(200);
            $.post("{:U('createAffQrcode')}", {}, function(data){
				<gt name="userInfo['level']" value="0">
				$('#createqrcode_').html('已经发送到微信，请查收！');
				<else/>
				$('#createqrcode_').html(data);
				</gt>
				
				setTimeout(function(){
					$('#createqrcode_').hide();
				},2000);
			},'html');
        });
		
        $.post('{:U('userCount')}',{},function(data){
			$('#usercount').html(data+'人');
		},'html');
		
		$.post('{:U('Home/Ajax/getOrderAff')}',{'orderstatus':1,member_id:<?php echo $_SESSION['memberInfo']['id'];?>},function(data){
			$('#orderNoPay').html(data+'单');
		},'html');
		$.post('{:U('Home/Ajax/getOrderAff')}',{'orderstatus':2,member_id:<?php echo $_SESSION['memberInfo']['id'];?>},function(data){
			$('#orderPayed').html(data+'单');
		},'html');
		
		$.post('{:U('Home/Ajax/getOrderAff')}',{'orderstatus':'1,2',member_id:<?php echo $_SESSION['memberInfo']['id'];?>},function(data){
			$('#orderPayedc').html(data+'单');
		},'html');
		$.post('{:U('Home/Ajax/getMemberCount')}',{'deep':1,member_id:<?php echo $_SESSION['memberInfo']['id'];?>},function(data){
			$('#usercount1').html(data+'人');
		},'html');
        $.post('{:U('Home/Ajax/getMemberCount')}',{'deep':2,member_id:<?php echo $_SESSION['memberInfo']['id'];?>},function(data){
			$('#usercount2').html(data+'人');
		},'html');
		$.post('{:U('Home/Ajax/getMemberCount')}',{'deep':3,member_id:<?php echo $_SESSION['memberInfo']['id'];?>},function(data){
			$('#usercount3').html(data+'人');
		},'html');
		$.post('{:U('Home/Ajax/getMemberVipCount')}',{member_id:<?php echo $_SESSION['memberInfo']['id'];?>},function(data){
			$('#vipusercount1').html(data.a+'人');
			$('#vipusercount2').html(data.b+'人');
			$('#usercountall').html(data.c+'人');
		},'json');
		
		//我的奖励
		$.post('{:U('Home/Ajax/getAffData')}',{member_id:<?php echo $_SESSION['memberInfo']['id'];?>},function(data){
			$('#AffMCount_1').html('¥'+data.a);
			$('#AffMCount_2').html('¥'+data.b);
			$('#AffMCount_3').html('¥'+data.c);
			$('#AffMCount_4').html('¥'+data.d);
			$('#AffMCount_5').html('¥'+data.e);
			$('#AffMCount_6').html('¥'+data.f);
			
			
			$('#usercount_1').html('¥'+(data.g));
			
			
			
		},'json');
		
		
		
		
		
		
    });
</script> 
<include file="Public:footer" />